/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       town_properties.h

	$Header: /game/town_properties.h $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "town_properties.h"

#include "bitmap_group_cache.h"
#include "external_string.h"
#include "town_type.h"

std::string get_town_type_name( t_town_type type )
{
	static std::string const names[] =
	{
		t_external_string( "Haven.town" ).get(),
		t_external_string( "Academy.town" ).get(),
		t_external_string( "Necropolis.town" ).get(),
		t_external_string( "Asylum.town" ).get(),
		t_external_string( "Preserve.town" ).get(),
		t_external_string( "Stronghold.town" ).get()
	};

	return names[type];
}

std::string get_alignment_name( t_town_type type )
{
	static std::string const names[] =
	{
		t_external_string( "Life.town" ).get(),
		t_external_string( "Order.town" ).get(),
		t_external_string( "Death.town" ).get(),
		t_external_string( "Chaos.town" ).get(),
		t_external_string( "Nature.town" ).get(),
		t_external_string( "Might.town" ).get()
	};

	return names[type];
}

t_bitmap_group_ptr get_town_thumbnail( t_town_type type, int width )
{
	static t_bitmap_group_cache const k_thumbnails_89[k_town_type_count + 1] = 
	{
		"town.random.89",
		"town.life.tiny",
		"town.order.tiny",
		"town.death.tiny",
		"town.chaos.tiny",
		"town.nature.tiny",
		"town.might.tiny"
	};

	// 140 width images were originally created for the caravans, hence the names
	static t_bitmap_group_cache const k_thumbnails_140[k_town_type_count + 1] = 
	{
		"town.random.140",
		"town.life.caravan",
		"town.order.caravan",
		"town.death.caravan",
		"town.chaos.caravan",
		"town.nature.caravan",
		"town.might.caravan"
	};

	if ( width >= 140 )
	{
		return k_thumbnails_140[type + 1].get();
	}
	else
	{
		return k_thumbnails_89[type + 1].get();
	}
}

